<!-- 选择页面框 -->
<template>
  <div
    class="Pager"
    style="margin-top:15px;"
  >
    <el-pagination
      text-align='center'
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-size="pageSize"
      layout=" prev, pager, next, total,sizes,jumper"
      :total="filterDataShow.length"
      @size-change="handleSizeChange"
      :page-sizes="[2,5,10,20]"
    >
    </el-pagination>

  </div>
</template>    
  
  
  <script>
export default {
  data() {
    return {
      currentPage: 1, // 当前页码
      total: 20, // 总条数
      pageSize: 2, // 每页的数据条数
    };
  },
  watch: {
    childValue(val) {
      /* this.$emit("currentPage", { value: this.currentPage }); //
      this.$emit("total", { value: total }); */
      this.$emit("pageSize", { value: this.pageSize }); //单向传递PageSize
    },
  },
  methods: {
    //每页条数改变时触发 选择一页显示多少行
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.currentPage = 1;
      this.pageSize = val;
    },
    //当前页改变时触发 跳转其他页
    handleCurrentChange(val) {
      //console.log(`当前页: ${val}`);
      this.currentPage = val;
    },
  },
};
</script>
  
  <style lang="scss" scoped>
</style>